CC = /usr/bin/gcc 
DEBUG = -g
INCLUDE_DIR =
CFLAGS =  ${DEBUG} ${INCLUDE_DIR} -D CE_ENGR -D LINUX 
LFLAGS = 
CSCOPE = cscope

.phony: all clean

all: clean server cscope

cscope: 
	@echo "Building cscope database"
	@rm -f cscope.out cscope.in.out cscope.po.out cscope.files
	$(CSCOPE) -b -q -R
	@ls -l cscope.out cscope.in.out cscope.po.out

superclean: clean
	@rm -f cscope.*
clean:
	@rm -f *.o *~ server

.c.o:
	@echo "Compiling $@"
	${CC} ${CFLAGS} -c $<

.cpp.o:
	@echo "Compiling $@"
	${CC} ${CFLAGS} -c $<


server.o: server_utils.h util.h
server_utils.o: server_utils.h util.h
bid_service.o: util.h
dynamic_session.o:
prov_service.o: util.h
admin_service.o: util.h
util.o: util.h
sock.o: sock.h



SERVER_OBJS=server.o bid_service.o prov_service.o admin_service.o \
	 util.o sock.o server_utils.o dynamic_session.o

server:${SERVER_OBJS}
	@echo "Linking $@"
	${CC} ${LFLAGS} ${SERVER_OBJS} -o $@ -lpthread

